<?php 
defined('IN_TS') or die('Access Denied.');
//秀店用户设置

switch($ts){
	//设置为管理员和取消为管理员
	case "isadmin":

		$userid = intval($_GET['userid']);
		$talkid = intval($_GET['talkid']);
		$isadmin = intval($_GET['isadmin']);
		
		if($userid == '' && $talkid=='' && $isadmin=='') qiMsg("请不要冒险进入危险境地！");
		
		$strGroup = $db->once_fetch_assoc("select * from ".dbprefix."talk where talkid='".$talkid."'");
		
		
		if($TS_USER['user']['userid'] != $strGroup['userid']) qiMsg("机房重地，闲人免进！");
		
		$db->query("update ".dbprefix."talk_users set `isadmin`='".$isadmin."' where userid='".$userid."' and talkid='".$talkid."'");

		header("Location: ".SITE_URL."index.php?app=talk&ac=talk_user&talkid=".$talkid."");
		
		break;
	
	//踢出秀店成员
	case "isuser":
		$userid = intval($_GET['userid']);
		$talkid = intval($_GET['talkid']);
		$isuser = intval($_GET['isuser']);
		
		if($userid == '' && $talkid=='' && $isuser=='') qiMsg("请不要冒险进入危险境地！");
		$strGroup = $db->once_fetch_assoc("select * from ".dbprefix."talk where talkid='".$talkid."'");
		if($TS_USER['user']['userid'] != $strGroup['userid']) qiMsg("机房重地，闲人免进！");
		
		$db->query("DELETE FROM ".dbprefix."talk_users WHERE userid = '$userid' AND talkid = '$talkid'");
		
		//计算秀店会员数
		$talkUserNum = $db->once_num_rows("select * from ".dbprefix."talk_users where talkid='$talkid'");
		
		//更新秀店成员统计
		$db->query("update ".dbprefix."talk set `count_user`='$talkUserNum' where talkid='$talkid'");
		
		header("Location: ".SITE_URL."index.php?app=talk&ac=talk_user&talkid=".$talkid."");
		
		break;
}